<?php
class FaqController extends DRX_Controller 
{
	function pageAction()
	{
		global $arrArgs;
		echo $arrArgs[0];
	}
	function indexAction()
	{
		$smarty 	= DRX::load("smarty");
		
		$layout     = new Layout();
		$args['topmenu_id'] = FAQ_ID;
		$layout->prepareLayout($args);
		
		$faqgroup = new Faqgroup();
		$faqgroupInfo = $faqgroup->getAllShowFaqGroup();
				
		while ($faqgroupInfo->fetch())
		{
		    $group_list[$faqgroupInfo->group_id] = $faqgroupInfo->group_name;
		    $group_faq = new Group_faq();
		    $group_question = $group_faq->getAllQuestionInGroup($faqgroupInfo->group_id);
		    $index = 0;
		    while ($group_question->fetch())
		    {
		        $index++;
                $question_list[$faqgroupInfo->group_id][$index]['question_answer'] = $group_question->question_answer;
                $question_list[$faqgroupInfo->group_id][$index]['question_title'] = $group_question->question_title;
                $question_list[$faqgroupInfo->group_id][$index]['question_order'] = $group_question->question_order;
		    }
		}
		$smarty->assign("group_list",$group_list);
		$smarty->assign("question_list",$question_list);
		$content = $smarty->fetch("faq/faq.tpl");
		$smarty->assign("content",$content);
		
		$smarty->display("solvay.tpl");
	}
}
?>
